﻿@using Utils;
@model WebUI.Models.IndShotsViewModel
@{
    ViewBag.Title = Model.Ind.FullName + " - JuicyBasket";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="mainCol">
    <div class="profile">
        <div class="fl">
            <a href="@Url.Action("Shots", new { UserName = Model.Login.UserName })" title="@Model.Ind.FullName">
                <img class="avatar80" src="@Url.StaticFile(Model.AvatarUrl)" alt="@Model.Ind.FullName"/>
            </a>
        </div>
        <div class="fl">
            <h1>
                <span>@Model.Ind.FullName</span>
            </h1>
            <div class="profile-title">
                <span>@Model.Ind.Title</span>
            </div>
            <div class="profile-detail">
                <div class="fl">
                    <a href="@Url.Action("Designers", "Search", new { location = Model.Ind.Location })" class="locality">@Model.Ind.Location</a>
                </div>
                @if (!string.IsNullOrEmpty(Model.Ind.PersonalUrl.ToDomainName()))
                {
                <div class="fl">
                    <a href="@Model.Ind.PersonalUrl" class="url" target="_blank">@Model.Ind.PersonalUrl.ToDomainName()</a>
                </div>
                }
                @if (!string.IsNullOrEmpty(Model.Ind.Twitter))
                {
                <div class="fl">
                    <a href="http://twitter.com/@Model.Ind.Twitter" class="twitter" target="_blank">@Model.Ind.Twitter</a>
                </div>
                }
            </div>
            
            <div class="clear"></div>
        </div>
    </div>
    <ul class="tabs">
        <li class="active">
            <a href="@Url.Action("Shots")">Shots<span class="count">@Model.Ind.ShotCount</span></a>
        </li>
        @if (Model.IsIndAccountOwner || Model.Ind.AvailableForHire)
        {
        <li>
            <a href="@Url.Action("Resume")">Resume</a>
        </li>
        }
        <li>
            <a href="@Url.Action("Tags")">Tags<span class="count">@Model.Ind.ShotTagCount</span></a>
        </li>
        @if (Model.IsIndAccountOwner)
        {
        <li>
            <a href="@Url.Action("SavedTalent")">Saved Talent</a>
        </li>
        <li>
            <a href="@Url.Action("SavedJobs")">Saved Jobs</a>
        </li>
        }
    </ul>
    <div class="tabsbottom"></div>
    <div class="clear"></div>
    @if (Model.ShotList.Count > 0)
    {
    <div class="shotlist">
        @for (int i = 0; i < Model.ShotList.Count; i++)
        {
            int colCount = 3;
            var shot = Model.ShotList[i];
            var divclass = string.Empty;
            if (i % colCount == colCount - 1)
            {
                divclass = "last";
            }
            <div class="shot @divclass">
                <div class="innershot">
                    <div class="image">
                        <a href="/shots/@shot.ShotID"><img src="@shot["ShotUrl"]" alt="@shot.Title"/></a>
                        
                    </div>
                    @if (!Model.IsIndAccountOwner)
                    {
                        <div class="title ellipsis">@shot.Title</div>
                    }
                    else
                    { 
                        <div class="title">
                            <div class="title1 ellipsis">@shot.Title</div>
                            <div class="uitools">
                                <a class="action_small deleteshot" href="/shots/@shot.ShotID/delete">
                                    <span>Delete</span>
                                </a>
                                <a class="action_small editshot" href="/shots/@shot.ShotID/edit">
                                    <span>Edit</span>
                                </a>
                            </div>
                            <div class="clear"></div>
                        </div>
                    }
                </div>
            </div>
        }
    </div>
    <div class="clear"></div>
    <div class="page">
        <div class="paging">
        @if (Model.PreviousPage > 0)
        {
            <a href="@Url.Action("shots", new { Page = Model.PreviousPage })" class="action pagingaction" rel="prev">← Newer</a>
        }
        @if (Model.NextPage > 0)
        {
            <a href="@Url.Action("shots", new { Page = Model.NextPage })" class="action pagingaction" rel="next">Older →</a>
        }
        </div>
    </div>
    }
    else
    { 
    <div class="null-message">
	    <h2>None</h2>
    </div>
    }
    <div class="clear"></div>
</div>
<div class="sideCol">
    <div class="profile">
        @*<div class="profile-tabs">		
            <div class="followers">
                <a href="/user/@Model.Login.UserName/followers">		
                    <span class="count">20</span>
	                <span class="meta">Followers</span>
                </a>
            </div>
            <div class="following last">
		        <a href="/user/@Model.Login.UserName/following">		
                    <span class="count">100</span>
		            <span class="meta">Following</span>
                </a>
            </div>
	    </div>*@
        <div class="clear"></div>
        <div class="smallspacer"></div>
        @if (!Model.IsIndAccountOwner)
        {
    
            <div>
                @if (Model.Identity.IsLoggedIn)
                {
                    if (Model.IsIndSaved)
                    {
                    <a class="action follow" href="@Url.Action("save", "account", new { LoginID = Model.Login.LoginID })" title="Save @Model.Ind.FullName's profile" style="display:none;"><span>Save</span></a>
                    <a class="action followed" href="@Url.Action("unsave", "account", new { LoginID = Model.Login.LoginID })" title="You saved @Model.Ind.FullName's profile. Click to remove"><span>Saved</span></a>
                    }
                    else
                    { 
                    <a class="action follow" href="@Url.Action("save", "account", new { LoginID = Model.Login.LoginID })" title="Save @Model.Ind.FullName's profile"><span>Save</span></a>
                    <a class="action followed" href="@Url.Action("unsave", "account", new { LoginID = Model.Login.LoginID })" title="You saved @Model.Ind.FullName's profile. Click to remove" style="display:none;"><span>Saved</span></a>
                    }
                }
                else
                { 
                    <a class="action follow gotosignin" href="/signin" title="Save @Model.Ind.FullName's profile"><span>Save</span></a>
                }
                @if (Model.Ind.AvailableForHire)
                {
                    if (Model.Identity.IsLoggedIn)
                    {
                        if (Model.IsSentRecently)
                        {
                        <a class="action contacted" href="@Url.Action("Show", "Message", new { ReceiptID = Model.Login.UserName })"><span>Sent Recently</span></a>
                        }
                        else
                        {
                        <a class="action contact" href="@Url.Action("New", "Message", new { ReceiptID = Model.Login.UserName })"><span>Hire Me</span></a>
                        <a class="action contacted" href="@Url.Action("Show", "Message", new { ReceiptID = Model.Login.UserName })" style="display:none;"><span>Sent Recently</span></a>
                        }
                    }
                    else
                    { 
                        <a class="action contact gotosignin" href="/signin">
                            <span>Hire Me</span>
                        </a>
                    }
                }
            </div>
            <div class="clear"></div>
        }
    
        @if (Model.IsIndAccountOwner)
        {
            <div>
                <a class="action editaccount" href="/ind/editprofile">
                    <span>Edit Account</span>
                </a>
                <a class="action uploadshot" href="/ind/uploadshot">
                    <span>Uploat Shot</span>
                </a>
            </div>
        }
    </div>
    <div class="clear"></div>
    @if (!string.IsNullOrEmpty(Model.Ind.Bio))
    {
        <ul class="tabs">
            <li>
                <h3>About<span>&nbsp;@Model.Ind.FullName</span></h3>
            </li>
        </ul>
        <div class="tabsbottom"></div>
        <div><p class="text">@Model.Ind.Bio</p></div>
        <div class="clear"></div>
    }
    
    @if (Model.SkillList.Count > 0)
    {
        <ul class="tabs">
            <li>
                <h3>Skills</h3>
            </li>
        </ul>
        <div class="tabsbottom"></div>
        <ol class="tags">
            @foreach (var skill in Model.SkillList)
            {
                <li><a href="@Url.Action("Designers", "Search", new { Skills = skill.Name })">@skill.Name</a></li>
            }
        
        </ol>
        <div class="clear"></div>
    }
    
</div>

@{Html.RenderPartial("_Overlay");}

@section FooterContent
{
    <script type="text/javascript" src="@Url.StaticFile("~/content/jquery.form.js")"></script>
    <script type="text/javascript" src="@Url.StaticFile("~/content/shots.js")"></script>
}